﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BE.Web.Betfair.Interface.Entities;
using System.Collections.ObjectModel;
using System.Diagnostics.Contracts;

namespace BE.Web.Betfair.Interface.Requests
{
    /// <summary>
    /// 
    /// </summary>
    public sealed class EventMarketsRequest : SessionBasedRequest<ReadOnlyCollection<BetMarket>>
    {
        [ContractInvariantMethod]
        void ObjectInvariant()
        {
            Contract.Invariant(this.BetEvent != null);
        }


        /// <summary>
        /// The Event
        /// </summary>
        public BetEvent BetEvent { get; private set; }

        /// <summary>
        /// Initializes a new instance of the <see cref="EventMarketsRequest"/> class.
        /// </summary>
        /// <param name="session">The session.</param>
        /// <param name="betEvent">The betevent</param>
        /// <param name="completedAction">The action which should be raised after completition</param>
        public EventMarketsRequest(Session session,BetEvent betEvent, Action<ReadOnlyCollection<BetMarket>> completedAction) :
            base(session,completedAction)
        {
            #region conditions
            Contract.Requires<ArgumentNullException>(session != null);
            Contract.Requires<ArgumentNullException>(completedAction != null);
            Contract.Requires<ArgumentNullException>(betEvent != null);
            Contract.Ensures(this.BetEvent != null);
            #endregion

            this.BetEvent = betEvent;
        
        }
    }
}
